<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN"
	dir="ltr">
<head>
<title>Moment Mobile Payments</title>
<%@ page
	import="java.util.Date,java.text.SimpleDateFormat,com.moment.model.UserReg"%>
<%!String ref = null;%>
<%!String merchantnumber = null;%>
<%!String notid = null;%>
<%!String amount = null;%>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/styles/layout.css" type="text/css" />
<link type='text/css' href='<%=request.getContextPath()%>/styles/basic_ie.css' rel='stylesheet'
	media='screen' />

<!-- Contact Form CSS files -->
<link type='text/css' href='styles/basic.css' rel='stylesheet'
	media='screen' />
<script>
	function getLocation() {

		if (navigator.geolocation) {
			navigator.geolocation.getCurrentPosition(showPosition, showError);
		} else {
			x.innerHTML = "Geolocation is not supported by this browser.";
		}
	}
	

	function showPosition(position) {

		var lat = document.getElementById('lat').value = position.coords.latitude;
		document.getElementById('longi').value = position.coords.longitude;
		if(lat > 0)
		{
			
			document.getElementById("submittransaction").disabled = false;
			document.getElementById("submittransaction").className = "";
			document.getElementById("submittransaction").className = "myButton";
		}

	}

	function showError(error) {
		switch (error.code) {
		case error.PERMISSION_DENIED:
			x.innerHTML = "User denied the request for Geolocation."
			break;
		case error.POSITION_UNAVAILABLE:
			x.innerHTML = "Location information is unavailable."
			break;
		case error.TIMEOUT:
			x.innerHTML = "The request to get user location timed out."
			break;
		case error.UNKNOWN_ERROR:
			x.innerHTML = "An unknown error occurred."
			break;
		}
	}
</script>



</head>
<jsp:useBean id="userObj" class="com.moment.model.UserReg"
	scope="session" />
<body id="top" onload="getLocation()">
	<%@include file="loggedinheader.jsp"%>
	<%!String s[];%>
	<%!String error = null;%>
	<%!String tid = null;%>
	<div class="wrapper col3">



		<div id="intro">
			<%
				error=(String)request.getParameter("error");
				  	tid=(String)request.getParameter("tid");
			      	System.out.println("Error="+error+"tid"+tid);
			      if(tid!=null){
			%>

			<div id="basic-modal-content">
				<center>
					<img src="http://192.168.0.105:8080/img/<%=tid%>" alt="report" />
				</center>
			</div>
			<script>
				function model() {
					$('#basic-modal-content').modal();
				}
			</script>
			<%
				}
			      if(error!=null ){
			%>
			<div class="alert-box error">
				<span>error: </span><%=error%></div>
			<%
				}
			%>
			<!-- modal content -->

			<div class="fl_left1">
			<center><h1>Payment</h1></center>
				<form action="../TransactionController" method="post"  autocomplete="off">

					<table>
				
						<%
							
						           Date d;
						           
						           d=new Date();
						           SimpleDateFormat ft = new SimpleDateFormat ("yyyyMMddhhmmss");

						            ref= userobj.getMob()+ft.format(d);
						%>
						<tr>
							<%
								merchantnumber = request.getParameter("merchantnumber");
							    notid = request.getParameter("notid");
							    amount = request.getParameter("amount");
							           s=(String[])session.getAttribute("instrumentlist");
							%>
							<td>Mobile No:</td>
							<td><input type="text" name="merMobile" id="merMobile"
								value="<%= merchantnumber %>"/></td></tr>
           <td>Instrument</td><td><select id="nameInstru" name="nameInstru">
           <% 
           System.out.println("iname"+request.getParameter("iname"));

           System.out.println("s="+s);
           for(String ss:s){
        	   String select = "";
        	   if(ss.equalsIgnoreCase(request.getParameter("iname")))
        	   {
        		   select = "selected='selected'";   
        	   }
           %>
           <option value="<%=ss%>" <%=select%>><%=ss%></option>
           <%
           }
           %>
           </select></td></tr>
           <td>Amount</td><td><input type="text" name="amt" id="amt" value="<%=amount%>"/>USD</td></tr>
           <td>Password</td><td><input type="password" name="password"  /></td></tr>
           <input type="hidden" id="custMobile" name ="custMobile" value="${userObj.mob}"/>
           <input type="hidden" id="lat" name="lat"  />
           <input type="hidden" id="longi" name ="longi"  />
           <input type="hidden" id="ref" name ="ref" value="<%=ref %>" />
           <input type="hidden" name="nid"  value="<%=notid %>"/>
           
        
          </form>
            </table>
          <div class="fl_right">
          <input type="submit" id="submittransaction" name="submittransaction" class="mydisabledButton" value="Submit" disabled/>
          </div>
          
      
    </div>
    </div>
    </div>
    <br class="clear" />
  </div>
  <%@include file="footer.jsp" %>
</div>

</body>
</html>
 <script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/js/jquery.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/js/jquery.simplemodal.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/js/basic.js'></script>

